//
//  DetailViewController.m
//  webservice2
//
//  Created by Anders Petersen on 30/07/14.
//  Copyright (c) 2014 Anders Petersen. All rights reserved.
//

#import "DetailViewController.h"

@interface DetailViewController ()
- (void)configureView;
@end

@implementation DetailViewController

#pragma mark - Managing the detail item

- (void)setDetailItem:(id)newDetailItem
{
        // Update the view.
        [self configureView];
}

- (void)configureView
{
    // Update the user interface for the detail item.

}

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    //remove spaces and next line.......
    
    NSLog(@"h%@h",[[self.url stringByReplacingOccurrencesOfString:@"\n" withString:@""]stringByTrimmingCharactersInSet:
          [NSCharacterSet whitespaceCharacterSet]]);
    //NSURL *myURL = [NSURL URLWithString: [self.url stringByAddingPercentEscapesUsingEncoding:
    //                                      NSUTF8StringEncoding]];
    //NSURLRequest *request = [NSURLRequest requestWithURL:myURL];
    
    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[[self.url stringByReplacingOccurrencesOfString:@"\n" withString:@""]stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]]]];
    
    //[self.webView loadRequest:request];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
